<?php

//login


require "database.php";

$base=new Db;

$username=$_POST['username'];
$password=$_POST['password'];

$_____r____=$base->doSql('select * from ey_admin where user_name="'.$username.'"');

$_____r____=$_____r____[0];


if($_____r____["password"]==md5($password)){
    return json([
        "code"=>200,
        "msg"=>"success",
        "data"=>[
            "username"=>$username,
            "admin_id"=>$_____r____["admin_id"]
        ]
    ]);
}else{
    return json([
        "code"=>-1,
        "msg"=>"fuiled"
    ]);
}


